<!DOCTYPE html>
<html lang="en">
<head>
    <title>地图</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <script type="text/javascript"
            src="https://api.map.baidu.com/api?v=2.0&ak=18eZsB5LvSoIf1HZOCUBDXKWHMbvhfpa"></script>
    <link rel="stylesheet" href="/dist/plugins/calendar/calendar.css" />
</head>
<style>
    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        margin: 1px;
        background: #ffffff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .allmap {
        width: 100%;
        height: 300px;
        overflow: hidden;
        margin: 0;
        font-family: "微软雅黑";
    }

    .templateStyle {
        margin-top: 5px;
        margin-left: 10px;
        margin-right: 10px;
        box-shadow: 2px 1px 2px #DDDDDD;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        position: absolute;
        top: 5px;
        line-height: 30px;
        float: left;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .boxItem {
        width: 100%;
        margin-top: 5px;
        background: inherit;
        /*background-color: rgba(255, 255, 255, 1);*/
        border: none;
        position: relative;
    }

    .templateStyle {
        margin-top: 15px;
        margin-left: 10px;
        margin-right: 10px;
        box-shadow: 2px 2px 3px #DDDDDD;
        position: relative;
    }

    .BMap_cpyCtrl {
        display: none;
    }

    .anchorBL {
        display: none;
    }

    .mapLog {
        /*background: rgb(255, 255, 255);*/
        z-index: 111111;
        overflow: hidden;
    }

    .leftLog {
        height: 16px;
        line-height: 16px;
        float: right;
    }

    .leftLog i {
        width: 8px;
        height: 8px;
        background: #1626ff;
        float: left;
        border-radius: 50%;
        margin: 4px 2px 0px;
    }

    .rightLog {
        height: 16px;
        line-height: 16px;
        float: right;

    }

    .rightLog i {
        width: 8px;
        height: 8px;
        background: red;
        float: left;
        border-radius: 50%;
        margin: 4px 2px 0px;
    }

    .ht-rili-leftarr,.ht-rili-rightarr{
        display: none;
    }
    .tryStyles {
        width: 50px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
        top: -2px;
        left: 100px;
        position: absolute;
        border-radius: 50px;
        margin-top: 4px;
        background: #ff131c;
        color: #fff;
        margin-right: -2px;
        transform: scale(0.5);
        text-align: center;
    }
    .tryStyles1 {
        width: 50px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
        top: 16px;
        left: 100px;
        position: absolute;
        border-radius: 50px;
        margin-top: 4px;
        background: #ff131c;
        color: #fff;
        margin-right: -2px;
        transform: scale(0.5);
        text-align: center;
    }
</style>
<body>

<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>

    <div v-for="(item,i) in firstVisitList">
        <div class="templateStyle">

            <!--天气-->
            <div style="position:relative;height: 28px;border: 1px solid #cbcbcd;background-color: #fff">
                <div class="weather" v-if="item.weather&&item.weather.text_day"
                     style="position:absolute;top: 0px;left:0px;">
                    <b style="margin: 0 2px;">{{item.weather.text_day}}</b><font
                        class="blue">{{item.weather.low}}</font>～<font
                        class="red">{{item.weather.high}}℃</font><img
                        :src="'/dist/img/weather/'+item.weather.code_day+'.png'"/></div>
                <div style="display:block;text-align: center;margin-top: 4px">首次面访</div>
                <div style="position:absolute;top: 0;right:0;bottom: 0;font-size: 12px;background: #2a8cec;color: #fff;padding: 3px 6px">
                    <span @click="lookInfo(item.userId)">
                        {{item.userName.length<3?item.userName.substring(0,1)+'&nbsp;&nbsp;&nbsp;&nbsp;'+item.userName.substring(1,2):item.userName}}
                    </span>
                </div>
            </div>
            <template v-if="item.signInLatitude">
                <div class="allmap" :id="'map'+i" v-line-inserted="i"
                     style="border: 1px solid #cbcbcd;"></div>
                <div style="padding: 5px 10px;border:  1px solid #cbcbcd;margin-top: -1px;position: relative;">
                    <div class="mapLog" v-if="item.signTime||item.arrivalsTime">
                        <div style="position: absolute;right: 13px;">
                            <div>
                                <span v-if="item.signTime"  class="leftLog" style="float: left;margin-top: 2px;">
                                    <!--<i  style="background: #1626ff;"></i>-->
                                    今日考勤签到：{{new Date(item.signTime).Format("hh:mm")}}</span><br>
                                <span v-if="item.signTime"  class="leftLog" style="float: left;margin-top: 4px;">
                                    <!--<i  style="background: red;"></i>-->
                                    首次面访签到：{{item.arrivalsTime? new Date(item.arrivalsTime).Format("hh:mm") : '&nbsp;--&nbsp;:&nbsp;--'}}</span>
                            </div>
                        </div>

                        <!--<span style="margin-right: 10px;">间隔：{{item.signInDiff?item.signInDiff:'&#45;&#45;'}}</span><br>-->
                        <!--<span style="margin-right: 10px;">距离：{{item.signInDistance?item.signInDistance:'&#45;&#45;'}}</span><br>-->
                        <!--<span style="">时速：{{item.signInspeed?item.signInspeed:'&#45;&#45;'}}</span>-->
                        间隔：
                        <span style="margin-right: 10px;" v-if="item.signInDiff != ''">
                                {{addZeroHour(quMiao(item.signInDiff))?addZeroHour(quMiao(item.signInDiff)):'--'}}
                                <template>
                                    <span class="tryStyles" v-if="!timeJq(item.signInDiff)">不合理</span>
                                </template>
                            </span>
                        <span v-else>--</span>
                        <br>
                        距离：
                        <span style="margin-right: 10px;" v-if="item.signInDiff != ''">
                                {{dJq(item.signInDistance)?dJq(item.signInDistance)+'公里':'--'}}
                                <template>
                                    <span class="tryStyles1" v-if="dJq(item.signInDistance)>15">不合理</span>
                                </template>
                            </span>
                        <span v-else>--</span>
                        <br>
                        时速：<span style="padding-left: 3px;" v-if="item.signInspeed != ''">{{item.signInspeed?item.signInspeed:'--'}}</span>
                        <span v-else style="padding-left: 3px;">--</span>
                    </div>

                </div>
            </template>
            <template v-else>
                <template v-if="item.signState==1">
                    <div style="height: 70px;line-height: 70px;text-align: center;background: #ffffff;border: 1px solid #cbcbcd;margin-top: -1px;">
                        <b style="color: #999999;">暂无首次面访</b>
                    </div>
                </template>
                <template v-else-if="item.signState==='0'">
                    <!--请假-->
                    <!--<div style="background: #ffffff;padding-left: 16px;padding-top: 16px;font-size: 16px;border: 1px solid #cbcbcd;margin-top: -1px;border-bottom: 0px;">-->
                    <!--请假：{{get_date(item.beginTime,item.endTime)}}-->
                    <!--</div>-->
                    <div class="calendar-box demo-box" :id="'demo-box'+i" v-calendar-inserted="i"></div>
                    <div style="padding:5px 10px;    border: 1px solid rgb(203, 203, 205);">
                        <div style="display: flex">
                            <span > 请假原因：</span>
                            <span style="flex: 1" class="qjyy">{{item.remark}}</span>
                        </div>
                    </div>
                </template>
                <template v-else-if="item.signState==2">
                    <!--缺勤-->
                    <div style="text-align: center;background: #ffffff;padding: 30px;border: 1px solid #cbcbcd;border-top: 0px;">
                        <div style="text-align: center"><img  width="45%"
                                                              src="/dist/img/icon_seal_queqin.png">
                        </div>
                    </div>
                </template>
            </template>
        </div>

    </div>
    <div style="margin-bottom: 15px;"></div>


</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/calendar/calendar-pro.js"></script>
<script type="text/javascript">
    //
</script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>

<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            dateTime: getUrlParamObj().dateTime,
            regionId: getUrlParamObj().departId?getUrlParamObj().departId:'',
            firstVisitList: [],
            signInList: []
        },
        methods: {
            isFair: function (item) {
                var str = '';
                if (!this.distanceJq(item.signInDistance) && !this.timeJq(item.signInTimeDiff)) {
                    str = "距离、时间不合理"
                }
                else if (!this.distanceJq(item.signInDistance)) {
                    str = "距离不合理"
                }
                else if (!this.timeJq(item.signInTimeDiff)) {
                    str = "时间不合理"
                }
                return str
            },
            //距离合理->true 不合理->false
            distanceJq: function (d) {
                var str = d.replace("公里", "");
                return Number(str) < 15
            },
            //时间合理->true 不合理->false
            timeJq: function (t) {
                if (t.indexOf("小时") > 0) {
                    var hour = t.split("小时")[0];
                    if (Number(hour) > 0) {
                        return false;
                    }
                } else {
                    if (t.indexOf("分") > 0) {
                        var min = t.split("分")[0];
                        if (Number(min) > 30) {
                            return false;
                        }
                    } else {
                        return true;
                    }
                }
                return true;
            },
            //距离间隔
            dJq: function (d) {
                var str = d.replace("公里", "");
                console.log("距离间隔 = "+ str)
                if (str == '0') {
                    return '';
                } else {
                    return Number(str).toFixed(2);
                }
            },
            //速度
            disJq: function (dis) {
                var str = dis.replace("km/h", "");
                return str;
            },
            //去秒加0几分
            quMiao: function (m) {
                if (!m) return ""
                //1小时11分11秒
                var hour = "0"
                var min = "0"
                var sec = "0"

                if (m.indexOf("小时") > 0) {
                    //{1  , 11分11秒} 1小时55秒
                    hour = m.split("小时")[0]
                }
                if (m.indexOf("分") > 0) {
                    //{1小时11，11秒}
                    min = m.split("分")[0]
                    if (min.indexOf("小时") > 0) {
                        //{1,11}
                        min = min.split("小时")[1]
                    }
                    if (Number(min) < 10) {
                        min = "0" + min
                    }
                }
                if (min == "0" && m.indexOf("秒") > 0) {
                    //21秒
                    return hour+"小时01分"
                }
                return hour + "小时" + min + "分"
            },
            //添加0小时xx分
            addZeroHour: function (h) {
                if (!h) {
                    return ""
                }
                if (h.indexOf('小时') > 0) {
                    return h
                } else {
                    return "0小时" + h
                }
            },
            //打开基本信息
            lookInfo: function (userId) {
                var that = this
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/personnel/entry.html?userId=' + userId,
                    name: '基本信息'
                }
                prompt(JSON.stringify(obj));
            },
            //获取天气
            get_weather: function (item, i, lat, lng) {
                var that = this;
                $.wyui.postMethod(urlConfig.other.getTheWeather, {
                    "lat": lat,
                    "lng": lng
                }, function (data) {
                    var weather = data.weather[0];
                    var obj = {
                        'text_day': weather.text_day,
                        'low': weather.low,
                        'high': weather.high,
                        'code_day': weather.code_day
                    }
                    that.firstVisitList[i].weather = obj
                    console.log(that.firstVisitList[i])
                }, true);
            },
            getFirstVisit: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getTodayFirstVisitAndSignForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId,
                }, function (data) {
                    console.log(data)
                    //只要大区经理自己的
                    that.firstVisitList= data.records.filter(function (element, i, self) {
                        if (self[i].userId == that.userId) {
                            return true;
                        }
                    })

                    for (var i = 0; i < that.firstVisitList.length; i++) {
                        for (var j = 0; j < that.signInList.length; j++) {
                            if (that.signInList[j].result.userId == that.firstVisitList[i].userId) {
                                that.firstVisitList[i]['signState'] = that.signInList[j].signState
                                that.firstVisitList[i]['beginTime'] = that.signInList[j].result.beginTime
                                that.firstVisitList[i]['endTime'] = that.signInList[j].result.endTime
                                that.firstVisitList[i]['remark'] = that.signInList[j].result.remark
                            }
                        }
                        if (data.records[i].signInLatitude) {
                            that.get_weather(data.records[i], i, data.records[i].signInLatitude, data.records[i].signInLongitude)
                        }
                    }
                    if (isWeiXin()) {

                    } else {
                        var dialog = {
                            dialog: 'hidden'
                        }
                        prompt(JSON.stringify(dialog))
                    }
                });
            },
            //获取考勤签到
            get_signIn: function () {
                var that = this;
                if (isWeiXin()) {

                } else {
                    var dialog = {
                        dialog: 'show'
                    }
                    prompt(JSON.stringify(dialog))
                }
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getTodaySignForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime
                }, function (data) {
                    that.signInList = data.records;

                    that.getFirstVisit()
                });
            },
            get_date: function (list) {
                var data;
                var current = [];
                var last = [];
                var next = [];
                var benNian = new Date().Format("yyyy");
                var benYue = new Date().Format("M");
                var lastTime = '';
                var currentTime = new Date().Format("yyyy-MM");
                var today = new Date().Format("yyyy-MM-dd");
                var nextTime = '';
                if (Number(benYue) + 1 > 12) {
                    nextTime = Number(benNian) + 1 + "-01"
                } else if (Number(benYue) + 1 < 10) {
                    nextTime = Number(benNian) + "-0" + (Number(benYue) + 1)
                } else {
                    nextTime = Number(benNian) + "-" + (Number(benYue) + 1)
                }
                if (Number(benYue) - 1 < 1) {
                    lastTime = Number(benNian) - 1 + "-12"
                } else if (Number(benYue) - 1 < 10) {
                    lastTime = Number(benNian) + "-0" + (Number(benYue) - 1)
                } else {
                    lastTime = Number(benNian) + "-" + (Number(benYue) - 1)
                }
                for(var i=0;i<list.length;i++){
                    if (lastTime == list[i].leaveDate.substring(0, 7)) {
                        last.push({date: list[i].leaveDate, data: '假',yy:list[i].remark})
                    }
                    if (currentTime == list[i].leaveDate.substring(0, 7)) {
                        if(today == list[i].leaveDate){
                            current.push({date:list[i].leaveDate, data: '假',today:true,yy:list[i].remark})
                        }else{
                            current.push({date:list[i].leaveDate, data: '假',yy:list[i].remark})
                        }
                    }
                    if (nextTime == list[i].leaveDate.substring(0, 7)) {
                        next.push({date: list[i].leaveDate, data: '假',yy:list[i].remark})
                    }
                }
                data = {
                    last: last,
                    current: current,
                    next: next
                }
                console.log(data)
                return data

            },
            getCountDays: function (dateStr) {//返回当月的天数
                var curDate = new Date(dateStr);
                var curMonth = curDate.getMonth();
                curDate.setMonth(curMonth + 1);
                curDate.setDate(0);
                return curDate.getDate();
            },
            setMessageReadFlag: function (receiverId) {
                $.wyui.postMethod(urlConfig.system.message.setMessageReadFlag, {
                    receiverId: receiverId,
                    flag: '1'
                }, function (data) {
                })
            }
        },
        mounted: function () {
            this.get_signIn();
            if (getUrlParamObj().msg=="0") {
                //从消息点进来的,标为已读
                this.setMessageReadFlag(getUrlParamObj().receiverId)
            }
        },
    })
</script>
<script>
    // 复杂的自定义覆盖物
    function ComplexCustomOverlay(point, text) {
        this._point = point;
        this._text = text;

    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
        this._map = map;
        var div = this._div = document.createElement("div");
        div.style.position = "absolute";
        div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
        div.style.backgroundColor = "#fff";
        div.style.border = "1px solid #333";
        div.style.color = "#333";
        div.style.height = "22px";
        div.style.paddingLeft = "2px";
        div.style.paddingRight = "2px";
        div.style.lineHeight = "20px";
        div.style.whiteSpace = "nowrap";
        div.style.MozUserSelect = "none";
        div.style.fontSize = "12px"
        var span = this._span = document.createElement("span");
        div.appendChild(span);
        span.appendChild(document.createTextNode(this._text));
        var that = this;

        var arrow = this._arrow = document.createElement("div");
        arrow.style.background = "url(/dist/img/jiao2.png) no-repeat";
        arrow.style.position = "absolute";
        arrow.style.width = "11px";
        arrow.style.height = "10px";
        arrow.style.top = "19px";
        arrow.style.left = "10px";
        arrow.style.overflow = "hidden";
        div.appendChild(arrow);

        map.getPanes().labelPane.appendChild(div);

        return div;
    }
    ComplexCustomOverlay.prototype.draw = function () {
        var map = this._map;
        var pixel = map.pointToOverlayPixel(this._point);
        this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
        this._div.style.top = pixel.y - 65 + "px";
    }

    // 复杂的自定义覆盖物2
    function ComplexCustomOverlay2(point, text) {
        this._point = point;
        this._text = text;

    }

    ComplexCustomOverlay2.prototype = new BMap.Overlay();
    ComplexCustomOverlay2.prototype.initialize = function (map) {
        this._map = map;
        var div = this._div = document.createElement("div");
        div.style.position = "absolute";
        div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
        div.style.backgroundColor = "#fff";
        div.style.border = "1px solid #333";
        div.style.color = "#333";
        div.style.height = "22px";
        div.style.paddingLeft = "2px";
        div.style.paddingRight = "2px";
        div.style.lineHeight = "20px";
        div.style.whiteSpace = "nowrap";
        div.style.MozUserSelect = "none";
        div.style.fontSize = "12px"
        var span = this._span = document.createElement("span");
        div.appendChild(span);
        span.appendChild(document.createTextNode(this._text));
        var that = this;

        var arrow = this._arrow = document.createElement("div");
        arrow.style.background = "url(/dist/img/jiao2.png) no-repeat";
        arrow.style.position = "absolute";
        arrow.style.width = "11px";
        arrow.style.height = "10px";
        arrow.style.top = "19px";
        arrow.style.left = "10px";
        arrow.style.overflow = "hidden";
        div.appendChild(arrow);

        map.getPanes().labelPane.appendChild(div);

        return div;
    }
    ComplexCustomOverlay2.prototype.draw = function () {
        var map = this._map;
        var pixel = map.pointToOverlayPixel(this._point);
        this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
        this._div.style.top = pixel.y - 86 + "px";
    }
    Vue.directive('line-inserted', {
        inserted: function (el, binding) {
            var lineIndex = binding.value;
            showMap(lineIndex);
        }
    });
    Vue.directive('calendar-inserted', {
        inserted: function (el, binding) {
            var lineIndex = binding.value;
            showCalendar(lineIndex);
        }
    });
    function showCalendar(lineIndex) {
        $.wyui.postMethod("/newAppReportForZSQ/getCalendar.json", {
            "userId": app.firstVisitList[lineIndex].userId,
            "dateTime": new Date().Format("yyyy-MM"),
        }, function (data) {
            var res = app.get_date(data)
            $('#demo-box' + lineIndex).calendar({
                ele: '#demo-box' + lineIndex, //依附
                title: '',
                data: res
            });
        });
    }
    //根据经纬度的距离获取地图的缩放级
    function getRoom(diff) {
        var room = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
        var diffArr = new Array(360, 180, 90, 45, 22, 11, 5, 2.5, 1.25, 0.6, 0.3, 0.15, 0.07, 0.03, 0);
        for (var i = 0; i < diffArr.length; i++) {
            if ((diff - diffArr[i]) >= 0) {
                return room[i];
            }
        }
        return 14;
    }

    //通过经纬度获取中心位置和缩放级别
    function getCenterPoint(maxJ, minJ, maxW, minW) {
        if (maxJ < minJ) {
            var minJ2 = maxJ
            maxJ = minJ
            minJ = minJ2
        }
        if (maxW < minW) {
            var minW2 = maxW
            maxW = minW
            minW = minW2
        }
        if (maxJ == minJ && maxW == minW) return [maxJ, maxW, 9];
        var diff = maxJ - minJ;
        if (diff < (maxW - minW)) diff = maxW - minW;
        diff = parseInt(10000 * diff) / 10000;
        var centerJ = minJ * 1000000 + 1000000 * (maxJ - minJ) / 2;
        var centerW = minW * 1000000 + 1000000 * (maxW - minW) / 2;
        var zoom = getRoom(diff);
        return [centerJ / 1000000, centerW / 1000000, zoom];
    }

    function showMap(lineIndex) {
        var id = "map" + lineIndex
        var num = lineIndex;
        console.log(num)
        var map = new BMap.Map(id);
        map.disableDragging();
        if (app.firstVisitList[num].signInLongitude && app.firstVisitList[num].arrivalsLongitude) {
            var CenterPoint = getCenterPoint(app.firstVisitList[num].signInLongitude, app.firstVisitList[num].arrivalsLongitude, app.firstVisitList[num].signInLatitude, app.firstVisitList[num].arrivalsLatitude)
            var point = new BMap.Point(CenterPoint[0], CenterPoint[1]);
            map.centerAndZoom(point, CenterPoint[2] - 1);
            var p1 = new BMap.Point(app.firstVisitList[num].signInLongitude, app.firstVisitList[num].signInLatitude);
            var p2 = new BMap.Point(app.firstVisitList[num].arrivalsLongitude, app.firstVisitList[num].arrivalsLatitude);
            var chaJ = Math.abs(Number(app.firstVisitList[num].signInLongitude) - Number(app.firstVisitList[num].arrivalsLongitude))
            var chaW = Math.abs(Number(app.firstVisitList[num].signInLatitude) - Number(app.firstVisitList[num].arrivalsLatitude))
            console.log(chaJ, chaW)
            var startIcon = new BMap.Icon("/dist/img/start.png", new BMap.Size(74, 106), {
                    imageOffset: new BMap.Size(0, -25)
                }
            );
            if (chaJ < 0.001 && chaW < 0.001) {
                var endIcon = new BMap.Icon("/dist/img/end.png", new BMap.Size(74, 106), {
                        imageOffset: new BMap.Size(10, -25)
                    }
                );
            } else {
                var endIcon = new BMap.Icon("/dist/img/end.png", new BMap.Size(74, 106), {
                        imageOffset: new BMap.Size(0, -25)
                    }
                );
            }
            var marker = new BMap.Marker(p1, {icon: startIcon});  // 创建标注
            var marker2 = new BMap.Marker(p2, {icon: endIcon});  // 创建标注
            map.addOverlay(marker);
            map.addOverlay(marker2);
            var myCompOverlay = new ComplexCustomOverlay(p1, "考勤签到 " + new Date(app.firstVisitList[num].signTime).Format("hh:mm"));
            if (chaJ < 0.001 && chaW < 0.001) {
                var myCompOverlay2 = new ComplexCustomOverlay2(p2, "首次面访签到 " + new Date(app.firstVisitList[num].arrivalsTime).Format("hh:mm"));
            } else {
                var myCompOverlay2 = new ComplexCustomOverlay(p2, "首次面访签到 " + new Date(app.firstVisitList[num].arrivalsTime).Format("hh:mm"));

            }
//            map.addOverlay(myCompOverlay);
//            map.addOverlay(myCompOverlay2);

        } else if (app.firstVisitList[num].signInLongitude) {
            var point = new BMap.Point(app.firstVisitList[num].signInLongitude, app.firstVisitList[num].signInLatitude);
            map.centerAndZoom(point, 13);
            var startIcon = new BMap.Icon("/dist/img/start.png", new BMap.Size(74, 106), {
                    imageOffset: new BMap.Size(0, -25)
                }
            );
            var marker2 = new BMap.Marker(point, {icon: startIcon});  // 创建标注
            map.addOverlay(marker2);
            var myCompOverlay = new ComplexCustomOverlay(point, "考勤签到 " + new Date(app.firstVisitList[num].signTime).Format("hh:mm"));
//            map.addOverlay(myCompOverlay);
        }
        else {
            var point = new BMap.Point(app.firstVisitList[num].arrivalsLongitude, app.firstVisitList[num].arrivalsLatitude);
            map.centerAndZoom(point, 13);
            var endIcon = new BMap.Icon("/dist/img/end.png", new BMap.Size(74, 106), {
                    imageOffset: new BMap.Size(0, -25)
                }
            );
            var marker2 = new BMap.Marker(point, {icon: endIcon});  // 创建标注
            map.addOverlay(marker2);
            var myCompOverlay = new ComplexCustomOverlay(point, "首次面访签到 " + new Date(app.firstVisitList[num].arrivalsTime).Format("hh:mm"));
//            map.addOverlay(myCompOverlay);
        }

    }
</script>
<script>
    var isDragEnable = true

    function setFaster() {
        if (isDragEnable) {
            //alert("Faster")
            map.disableDragging();
            map2.disableDragging();
        }
    }

    function setSlower() {
        //alert("slower")
        if (isDragEnable) {
            map.enableDragging();
            map2.enableDragging();
        }
    }


</script>
</body>
</html>